<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

$app->group([
        'namespace' => 'App\Http\Controllers'
    ], function ($app) {
        $app->get('', 'DefaultController@index');
        $app->get('/logout.html', 'DefaultController@logout');
        $app->get('/asset/repair.html', 'AssetController@repairIndex');

        $app->get('/finance/rent.html', 'FinanceController@rentIndex');
        $app->get('/finance/rent/view.html', 'FinanceController@rentView');
        $app->get('/finance/fee/water.html', 'FinanceController@feeWater');
        $app->get('/finance/fee/electric.html', 'FinanceController@feeElectric');
        $app->get('/finance/fee/gas.html', 'FinanceController@feeGas');
        $app->get('/finance/fee/view.html', 'FinanceController@feeView');

        $app->get('/hro/teacher.html', 'HroController@teacherIndex');
        $app->get('/hro/teacher/view/{id}.html', 'HroController@teacherView');

        $app->get('/teacher/file.html', 'TeacherController@fileIndex');
        $app->get('/teacher/file/edit.html', 'TeacherController@fileEdit');
        $app->get('/teacher/program.html', 'TeacherController@programIndex');
        $app->get('/teacher/program/view/{id}.html', 'TeacherController@programView');
        $app->get('/teacher/apart.html', 'TeacherController@apartIndex');
        $app->get('/teacher/contract.html', 'TeacherController@contractIndex');
        $app->get('/teacher/contract/view.html', 'TeacherController@contractView');
        $app->get('/teacher/rent.html', 'TeacherController@rentIndex');
        $app->get('/teacher/rent/view.html', 'TeacherController@rentView');
        $app->get('/teacher/fee/water.html', 'TeacherController@feeWater');
        $app->get('/teacher/fee/electric.html', 'TeacherController@feeElectric');
        $app->get('/teacher/fee/gas.html', 'TeacherController@feeGas');
        $app->get('/teacher/fee/view.html', 'TeacherController@feeView');
        $app->get('/teacher/repair.html', 'TeacherController@repairIndex');
        $app->get('/teacher/repair/create.html', 'TeacherController@repairCreate');
        $app->get('/teacher/repair/view.html', 'TeacherController@repairView');
        $app->get('/teacher/retire.html', 'TeacherController@retireIndex');
        $app->get('/teacher/notice.html', 'TeacherController@noticeIndex');
        $app->get('/teacher/notice/{id}.html', 'TeacherController@noticeView');

        $app->get('/template/{contract_id}.html', 'DefaultController@contractTemplate');
        $app->get('/contract/{contract_id}/identity.html', 'DefaultController@contractIdentity');

        $app->get('/manager/apart.html', 'ManagerController@apartIndex');
        $app->get('/manager/apart/view/{id}.html', 'ManagerController@apartView');
        $app->get('/manager/apart/create.html', 'ManagerController@apartCreate');
        $app->get('/manager/apart/edit/{id}.html', 'ManagerController@apartEdit');
        $app->get('/manager/apart/region.html', 'ManagerController@apartRegion');
        $app->get('/manager/apart/region/create.html', 'ManagerController@apartRegionCreate');
        $app->get('/manager/apart/region/edit/{id}.html', 'ManagerController@apartRegionEdit');
        $app->get('/manager/apart/standard.html', 'ManagerController@apartStandard');
        $app->get('/manager/apart/standard/create.html', 'ManagerController@apartStandardCreate');
        $app->get('/manager/apart/standard/edit/{id}.html', 'ManagerController@apartStandardEdit');

        $app->get('/manager/program.html', 'ManagerController@programIndex');
        $app->get('/manager/program/view/{id}.html', 'ManagerController@programView');
        $app->get('/manager/program/create.html', 'ManagerController@programCreate');
        $app->get('/manager/program/edit/{id}.html', 'ManagerController@programEdit');
        $app->get('/manager/program/{id}/apart.html', 'ManagerController@programApart');
        $app->get('/manager/program/{id}/user.html', 'ManagerController@programUser');
        $app->get('/manager/program/user/{id}/apart.html', 'ManagerController@programUserApart');

        $app->get('/manager/contract.html', 'ManagerController@contractIndex');
        $app->get('/manager/contract/view/{id}.html', 'ManagerController@contractView');
        $app->get('/manager/contract/create.html', 'ManagerController@contractCreate');
        $app->get('/manager/contract/edit/{id}.html', 'ManagerController@contractEdit');
        $app->get('/manager/contract/template.html', 'ManagerController@contractTemplate');
        $app->get('/manager/contract/template/create.html', 'ManagerController@templateCreate');
        $app->get('/manager/contract/template/edit/{id}.html', 'ManagerController@templateEdit');
        $app->get('/manager/contract/template/view/{id}.html', 'ManagerController@templateView');

        $app->get('/manager/fee/water.html', 'ManagerController@feeWater');
        $app->get('/manager/fee/electric.html', 'ManagerController@feeElectric');
        $app->get('/manager/fee/gas.html', 'ManagerController@feeGas');
        $app->get('/manager/fee/create-water.html', 'ManagerController@waterCreate');
        $app->get('/manager/fee/create-electric.html', 'ManagerController@electricCreate');
        $app->get('/manager/fee/create-gas.html', 'ManagerController@gasCreate');

        $app->get('/manager/rent.html', 'ManagerController@rentIndex');
        $app->get('/manager/rent/create.html', 'ManagerController@rentCreate');
        $app->get('/manager/rent/edit/{id}.html', 'ManagerController@rentEdit');

        $app->get('/manager/retire.html', 'ManagerController@retireIndex');

        $app->get('/manager/repair.html', 'ManagerController@repairIndex');

        $app->get('/manager/notice.html', 'ManagerController@noticeIndex');
        $app->get('/manager/notice/create.html', 'ManagerController@noticeCreate');
        $app->get('/manager/notice/edit/{id}.html', 'ManagerController@noticeEdit');
        $app->get('/manager/notice/view/{id}.html', 'ManagerController@noticeView');

        $app->get('/manager/teacher.html', 'ManagerController@teacherIndex');
        $app->get('/manager/teacher/view/{id}.html', 'ManagerController@teacherView');

        $app->get('/manager/user/apart/{id}.html', 'ManagerController@userApart');

        $app->get('/manager/role.html', 'ManagerController@role');
    });

$app->group([
        'namespace' => 'App\Http\Controllers\V1'
    ], function ($app) {
        $app->get('/v1/base/info.json', 'DefaultController@info');
        $app->get('/v1/regions.json', 'DefaultController@regions');
        $app->get('/v1/standards.json', 'DefaultController@standards');
        $app->get('/v1/aparts.json', 'DefaultController@aparts');
        $app->get('/v1/programs.json', 'DefaultController@programs');
        $app->get('/v1/program/users.json', 'DefaultController@programUsers');
        $app->get('/v1/program/aparts.json', 'DefaultController@programAparts');
        $app->get('/v1/contract/template.json', 'DefaultController@contractTemplate');
        $app->get('/v1/index.json', 'ManagerController@index');
        $app->get('/v1/type.json', 'ManagerController@type');
        $app->get('/v1/area.json', 'ManagerController@area');
        $app->get('/v1/apart/list.json', 'ManagerController@apartList');
        $app->get('/v1/apart/detail.json', 'ManagerController@apartDetail');
        $app->get('/v1/program/list.json', 'ManagerController@programList');
        $app->get('/v1/program/detail.json', 'ManagerController@programDetail');
        $app->get('/v1/rent/list.json', 'ManagerController@rentList');
        $app->get('/v1/apply/list.json', 'ManagerController@applyList');
        $app->get('/v1/select/list.json', 'ManagerController@selectList');
        $app->get('/v1/contract/list.json', 'ManagerController@contractList');
        $app->get('/v1/contract/detail.json', 'ManagerController@contractDetail');
        $app->get('/v1/hire/list.json', 'ManagerController@hireList');
        $app->get('/v1/fee/list.json', 'ManagerController@feeList');
        $app->get('/v1/retire/list.json', 'ManagerController@retireList');
        $app->get('/v1/repair/list.json', 'ManagerController@repairList');
        $app->get('/v1/notice/list.json', 'ManagerController@noticeList');

        $app->get('/v1/asset/repair/list.json', 'AssetController@repairList');
        $app->get('/v1/asset/repair/detail.json', 'AssetController@repairDetail');

        $app->get('/v1/finance/fee/list.json', 'FinanceController@feeList');
        $app->get('/v1/finance/fee/{type}/list.json', 'FinanceController@feeTypeList');
        $app->get('/v1/finance/fee/detail.json', 'FinanceController@feeDetail');
        $app->get('/v1/finance/rent/list.json', 'FinanceController@rentList');
        $app->get('/v1/finance/rent/detail.json', 'FinanceController@rentDetail');

        $app->get('/v1/hro/teacher/list.json', 'HroController@teacherList');
        $app->get('/v1/hro/teacher/detail.json', 'HroController@teacherDetail');
        $app->get('/v1/hro/teacher/score/list.json', 'HroController@teacherScoreList');

        $app->get('/v1/manager/apart/list.json', 'ManagerController@apartList');
        $app->get('/v1/manager/apart/detail.json', 'ManagerController@apartDetail');
        $app->get('/v1/manager/apart/user/{id}.json', 'ManagerController@userApart');
        $app->get('/v1/manager/standard/list.json', 'ManagerController@standardList');
        $app->get('/v1/manager/standard/detail.json', 'ManagerController@standardDetail');
        $app->get('/v1/manager/region/list.json', 'ManagerController@regionList');
        $app->get('/v1/manager/region/detail.json', 'ManagerController@regionDetail');

        $app->get('/v1/manager/contract/list.json', 'ManagerController@contractList');
        $app->get('/v1/manager/user/contract/list.json', 'ManagerController@userContractList');
        $app->get('/v1/manager/contract/detail.json', 'ManagerController@contractDetail');
        $app->get('/v1/manager/template/list.json', 'ManagerController@templateList');
        $app->get('/v1/manager/contract/templates.json', 'ManagerController@contractTemplates');
        $app->get('/v1/manager/template/detail.json', 'ManagerController@templateDetail');

        $app->get('/v1/manager/fee/list.json', 'ManagerController@feeList');
        $app->get('/v1/manager/fee/{type}/list.json', 'ManagerController@feeTypeList');
        $app->get('/v1/manager/fee/last.json', 'ManagerController@feeLast');

        $app->get('/v1/manager/notice/list.json', 'ManagerController@noticeList');
        $app->get('/v1/manager/notice/detail.json', 'ManagerController@noticeDetail');

        $app->get('/v1/manager/program/list.json', 'ManagerController@programList');
        $app->get('/v1/manager/program/detail.json', 'ManagerController@programDetail');
        $app->get('/v1/manager/program/{id}/apart/list.json', 'ManagerController@programApartList');
        $app->get('/v1/manager/unselected/aparts.json', 'ManagerController@unselectedAparts');

        $app->get('/v1/manager/program/{id}/user/list.json', 'ManagerController@programUserList');
        $app->get('/v1/manager/program/user/{id}/apart/list.json', 'ManagerController@programUserApartList');

        $app->get('/v1/manager/rent/list.json', 'ManagerController@rentList');
        $app->get('/v1/manager/rent/detail.json', 'ManagerController@rentDetail');
        $app->get('/v1/manager/rent/last.json', 'ManagerController@rentLast');

        $app->get('/v1/manager/repair/list.json', 'ManagerController@repairList');
        $app->get('/v1/manager/repair/detail.json', 'ManagerController@repairDetail');

        $app->get('/v1/manager/retire/list.json', 'ManagerController@retireList');
        $app->get('/v1/manager/retire/detail.json', 'ManagerController@retireDetail');

        $app->get('/v1/manager/teacher/list.json', 'ManagerController@teacherList');
        $app->get('/v1/manager/teacher/detail.json', 'ManagerController@teacherDetail');
        $app->get('/v1/manager/teacher/score/list.json', 'ManagerController@teacherScoreList');

        $app->get('/v1/manager/role/list.json', 'ManagerController@roleList');

        $app->get('/v1/teacher/apart/list.json', 'TeacherController@apartList');
        $app->get('/v1/teacher/apart/detail.json', 'TeacherController@apartDetail');
        $app->get('/v1/teacher/contract/list.json', 'TeacherController@contractList');
        $app->get('/v1/teacher/contract/detail.json', 'TeacherController@contractDetail');

        $app->get('/v1/teacher/fee/list.json', 'TeacherController@feeList');
        $app->get('/v1/teacher/fee/{type}/list.json', 'TeacherController@feeTypeList');
        $app->get('/v1/teacher/fee/detail.json', 'TeacherController@feeDetail');

        $app->get('/v1/teacher/file.json', 'TeacherController@file');

        $app->get('/v1/teacher/notice/list.json', 'TeacherController@noticeList');
        $app->get('/v1/teacher/notice/detail.json', 'TeacherController@noticeDetail');

        $app->get('/v1/teacher/program/list.json', 'TeacherController@programList');
        $app->get('/v1/teacher/program/detail.json', 'TeacherController@programDetail');
        $app->get('/v1/teacher/program/{id}/apart/list.json', 'TeacherController@programApartList');

        $app->get('/v1/teacher/rent/list.json', 'TeacherController@rentList');
        $app->get('/v1/teacher/rent/detail.json', 'TeacherController@rentDetail');

        $app->get('/v1/teacher/repair/list.json', 'TeacherController@repairList');
        $app->get('/v1/teacher/repair/detail.json', 'TeacherController@repairDetail');
        $app->get('/v1/teacher/retire/list.json', 'TeacherController@retireList');
        $app->get('/v1/teacher/retire/detail.json', 'TeacherController@retireDetail');
        $app->get('/v1/teacher/units.json', 'TeacherController@units');

        $app->post('/v1/upload', 'UploadController@index');
        $app->post('/v1/upfile', 'UploadController@file');

        $app->post('/v1/asset/delete/repair', 'AssetController@repairDelete');
        $app->post('/v1/finance/delete/rent', 'FinanceController@rentDelete');
        $app->post('/v1/finance/delete/fee', 'FinanceController@feeDelete');
        $app->post('/v1/hro/check/teacher', 'HroController@teacherCheck');
        $app->post('/v1/hro/delete/teacher', 'HroController@teacherDelete');
        $app->post('/v1/hro/teacher/score/save', 'HroController@saveScore');
        $app->post('/v1/manager/save/apart', 'ManagerController@apartSave');
        $app->post('/v1/manager/import/apart', 'ManagerController@apartImport');
        $app->post('/v1/manager/update/apart', 'ManagerController@apartUpdate');
        $app->post('/v1/manager/delete/apart', 'ManagerController@apartDelete');
        $app->post('/v1/manager/save/region', 'ManagerController@regionSave');
        $app->post('/v1/manager/update/region', 'ManagerController@regionUpdate');
        $app->post('/v1/manager/delete/region', 'ManagerController@regionDelete');
        $app->post('/v1/manager/save/standard', 'ManagerController@standardSave');
        $app->post('/v1/manager/update/standard', 'ManagerController@standardUpdate');
        $app->post('/v1/manager/delete/standard', 'ManagerController@standardDelete');
        $app->post('/v1/manager/save/program', 'ManagerController@programSave');
        $app->post('/v1/manager/update/program', 'ManagerController@programUpdate');
        $app->post('/v1/manager/delete/program', 'ManagerController@programDelete');
        $app->post('/v1/manager/delete/repair', 'ManagerController@repairDelete');
        $app->post('/v1/manager/delete/fee', 'ManagerController@feeDelete');
        $app->post('/v1/manager/save/contract', 'ManagerController@contractSave');
        $app->post('/v1/manager/update/contract', 'ManagerController@contractUpdate');
        $app->post('/v1/manager/delete/contract', 'ManagerController@contractDelete');
        $app->post('/v1/manager/save/template', 'ManagerController@saveTemplate');
        $app->post('/v1/manager/delete/template', 'ManagerController@deleteTemplate');
        $app->post('/v1/manager/program/add/aparts', 'ManagerController@addProgramAparts');
        $app->post('/v1/manager/program/{id}/delete/apart', 'ManagerController@deleteProgramApart');
        $app->post('/v1/program/user/change/status', 'ManagerController@changeProgramUserStatus');
        $app->post('/v1/user/apart/change/status', 'ManagerController@changeUserApartStatus');
        $app->post('/v1/teacher/program/apply', 'TeacherController@programApply');
        $app->post('/v1/teacher/select/apart', 'TeacherController@apartSelect');
        $app->post('/v1/teacher/save/repair', 'TeacherController@repairSave');
        $app->post('/v1/teacher/delete/repair', 'TeacherController@repairDelete');
        $app->post('/v1/teacher/save/file', 'TeacherController@fileSave');
        $app->post('/v1/teacher/apply/apart', 'TeacherController@apartApply');
        $app->post('/v1/teacher/change/contract/process', 'TeacherController@changeContractProcess');
        $app->post('/v1/teacher/rent/change/pay', 'TeacherController@changeRentPay');
        $app->post('/v1/teacher/fee/change/pay', 'TeacherController@changeFeePay');
        $app->post('/v1/manager/change/contract/process', 'ManagerController@changeContractProcess');
        $app->post('/v1/manager/save/notice', 'ManagerController@noticeSave');
        $app->post('/v1/manager/check/teacher', 'ManagerController@teacherCheck');
        $app->post('/v1/manager/delete/teacher', 'ManagerController@teacherDelete');
        $app->post('/v1/manager/update/notice', 'ManagerController@noticeUpdate');
        $app->post('/v1/asset/change/repair/status', 'AssetController@changeRepairStatus');
        $app->post('/v1/manager/change/pay/type', 'ManagerController@changePayType');
        $app->post('/v1/manager/rent/change/pay/type', 'ManagerController@changeRentPayType');
        $app->post('/v1/manager/teacher/score/save', 'ManagerController@saveScore');
        $app->post('/v1/finance/change/pay/type', 'FinanceController@changePayType');
        $app->post('/v1/finance/rent/change/pay/type', 'FinanceController@changeRentPayType');
        $app->post('/v1/teacher/create/retire', 'TeacherController@retireCreate');
        $app->post('/v1/teacher/delete/retire', 'TeacherController@retireDelete');
        $app->post('/v1/teacher/release/apart', 'TeacherController@apartRelease');
        $app->post('/v1/manager/save/fee', 'ManagerController@feeSave');
        $app->post('/v1/manager/save/rent', 'ManagerController@rentSave');
        $app->post('/v1/manager/update/rent', 'ManagerController@rentUpdate');
        $app->post('/v1/manager/delete/rent', 'ManagerController@rentDelete');
        $app->post('/v1/manager/delete/notice', 'ManagerController@noticeDelete');
        $app->post('/v1/manager/change/repair/status', 'ManagerController@changeRepairStatus');
        $app->post('/v1/manager/save/retire', 'ManagerController@retireSave');
        $app->post('/v1/manager/delete/retire', 'ManagerController@retireDelete');

        $app->post('/v1/manager/change/role', 'ManagerController@roleChange');


        //pay interface
        $app->get('/v1/teacher/select/order.json', 'TeacherController@orderSelect');
        $app->post('/v1/teacher/create/order', 'TeacherController@orderCreate');

        //msg interface
        $app->get('/v1/get/token.json', 'DefaultController@getToken');
        $app->post('/v1/send/msg', 'DefaultController@sendSms');

        $app->post('/v1/manager/send/msg', 'ManagerController@sendSms');
    });